package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TbUserInfo;
import com.ruoyi.system.domain.vo.MemberCardVO;
import com.ruoyi.system.service.ITbUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbMemberCardMapper;
import com.ruoyi.system.domain.TbMemberCard;
import com.ruoyi.system.service.ITbMemberCardService;

import javax.annotation.Resource;

/**
 * 会员卡Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-18
 */
@Service
public class TbMemberCardServiceImpl implements ITbMemberCardService 
{
    @Autowired
    private TbMemberCardMapper tbMemberCardMapper;



    /**
     * 查询会员卡
     * 
     * @param id 会员卡主键
     * @return 会员卡
     */
    @Override
    public TbMemberCard selectTbMemberCardById(Long id)
    {
        return tbMemberCardMapper.selectTbMemberCardById(id);
    }

    /**
     * 查询会员卡列表
     * 
     * @param tbMemberCard 会员卡
     * @return 会员卡
     */
    @Override
    public List<TbMemberCard> selectTbMemberCardList(TbMemberCard tbMemberCard)
    {
        return tbMemberCardMapper.selectTbMemberCardList(tbMemberCard);
    }

    /**
     * 新增会员卡
     * 
     * @param tbMemberCard 会员卡
     * @return 结果
     */
    @Override
    public int insertTbMemberCard(TbMemberCard tbMemberCard)
    {
        tbMemberCard.setCreateTime(DateUtils.getNowDate());
        return tbMemberCardMapper.insertTbMemberCard(tbMemberCard);
    }

    /**
     * 修改会员卡
     * 
     * @param tbMemberCard 会员卡
     * @return 结果
     */
    @Override
    public int updateTbMemberCard(TbMemberCard tbMemberCard)
    {
        return tbMemberCardMapper.updateTbMemberCard(tbMemberCard);
    }

    /**
     * 批量删除会员卡
     * 
     * @param ids 需要删除的会员卡主键
     * @return 结果
     */
    @Override
    public int deleteTbMemberCardByIds(Long[] ids)
    {
        return tbMemberCardMapper.deleteTbMemberCardByIds(ids);
    }

    /**
     * 删除会员卡信息
     * 
     * @param id 会员卡主键
     * @return 结果
     */
    @Override
    public int deleteTbMemberCardById(Long id)
    {
        return tbMemberCardMapper.deleteTbMemberCardById(id);
    }

    @Override
    public List<MemberCardVO> getCardList() {
        return tbMemberCardMapper.getCardList();
    }
}
